import pytest
from base_api.base_api import BaseApi
from base_tools.my_logger import logger
from config import *
import allure

@pytest.fixture(scope="session")
def get_token():
    logger.info("前置处理，获取通讯录同步模块接口请求的token。。。")
    with allure.step("初始化接口请求对象"):
        api_obj = BaseApi()
    with allure.step("调用获取token的方法获取token"):
        api_obj.get_token(url=token_url, corpid=corpid, corpsecret=corpsecret)
    return api_obj